<?php

namespace Library\Models;

use \Library\Entities\Channels;

class ChannelsManager_PDO extends ChannelsManager {

    public function getList($debut = -1, $limite = -1) {
        $sql = 'SELECT id, nom, number_of_download, poster, date_depot, description FROM contenu ORDER BY id DESC';
        if ($debut != -1 || $limite != -1) {
            $sql .= ' LIMIT ' . (int) $limite . ' OFFSET ' . (int)
                    $debut;
        }
        $requete = $this->dao->query($sql);
        $requete->setFetchMode(\PDO::FETCH_CLASS | \PDO::FETCH_PROPS_LATE, '\Library\Entities\Channels');
        $listeChan = $requete->fetchAll();
        foreach ($listeChan as $Chan) {
            //rien pour le moment
        }
        $requete->closeCursor();
        return $listeChan;
    }
    
    public function addChannel(){
        
        
    }

}

?>
